<?php

namespace JsonLowCode\Form\Fields;

class DateRangePickerField extends DatePickerField
{
    protected function booted(): void
    {
        parent::booted();
        $this->date();
    }

    /**
     * 年份范围选择
     * @return $this
     */
    public function year(): static
    {
        return $this->type("yearrange");
    }

    /**
     * 季节范围选择
     * @return $this
     */
    public function quarter(): static
    {
        return $this->type("quarterrange");
    }

    /**
     * 月份范围选择
     * @return $this
     */
    public function month(): static
    {
        return $this->type("monthrange");
    }

    /**
     * 日期范围选择
     * @return $this
     */
    public function date(): static
    {
        return $this->type("daterange");
    }

    /**
     * 日期时间范围选择
     * @return $this
     */
    public function datetime(): static
    {

        return $this->type("datetimerange");
    }

}
